
package org.wing.mouseListener;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.JLabel;
import org.come.Frame.TestpackJframe;
import org.come.Frame.ZhuFrame;
import org.come.Jpanel.TestpackJapnel;
import org.come.Jpanel.ZhuJpanel;
import org.come.entity.Goodstable;
import org.wing.panel.WingMainPanel;

public class ChooseGoodsMouseListener extends MouseAdapter
{

	private WingMainPanel wingMainPanel;

	public ChooseGoodsMouseListener(WingMainPanel wingMainPanel)
	{
		this.wingMainPanel = wingMainPanel;
	}

	@Override
    public void mousePressed(MouseEvent e)
	{
		if (wingMainPanel.getRightType() == 4) {
            return;
        }
		if (e.getButton() == 3 && wingMainPanel.getChosegoods() != null)
		{
			wingMainPanel.setChosegoods(null);
			wingMainPanel.getChooseGoodsImg().setIcon(null);
		}
	}

	@Override
    public void mouseEntered(MouseEvent e)
	{
		Goodstable goodstable = wingMainPanel.getChosegoods();
		if (goodstable != null) {
            ZhuFrame.getZhuJpanel().creatgoodtext(goodstable);
        }
	}

	@Override
    public void mouseExited(MouseEvent e)
	{
		TestpackJframe.getTestpackJframe().getJpac().ClearText();
		ZhuFrame.getZhuJpanel().cleargoodtext();
	}
}
